package com.scut.edu.wanyou.channel;

import org.json.JSONException;
import org.json.JSONObject;

public class Category {
	
	private int cat_id = -1;
	private String cat_name = "";
	private String slug = "";
	
	public Category(){}
	
	public int getCat_id() {
		return cat_id;
	}

	public void setCat_id(int cat_id) {
		this.cat_id = cat_id;
	}

	public String getCat_name() {
		return cat_name;
	}

	public void setCat_name(String cat_name) {
		this.cat_name = cat_name;
	}

	public String getSlug() {
		return slug;
	}

	public void setSlug(String slug) {
		this.slug = slug;
	};
	
	public boolean parser(JSONObject json)
	{
		try {
			setCat_id(json.getInt("cat_id"));
			setCat_name(json.getString("cat_name"));
			setSlug(json.getString("slug"));
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			return false;
		}
		return true;
	}

}
